let express = require('express');
let app = express();
let path = require('path'); //拼接路径
app.use(express.static(path.join(__dirname,'public')));
app.use(express.static(path.join(__dirname)));  //以当前根目录为静态目录加载

let cookieParser = require('cookie-parser');
app.use(cookieParser());  //req.cookies['connect.sid']  获取cookies

let bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({extended:true}))       //a=1&b=2 变成 {a:1,b:2} 挂载在req.body上

app.listen(8001);
  